/*==============================================================*/
/* DBMS name:      Microsoft SQL Server 2012                    */
/* Created on:     2021/10/26 9:24:08                           */
/*==============================================================*/


if exists (select 1
            from  sysobjects
           where  id = object_id('Charge')
            and   type = 'U')
   drop table Charge
go

if exists (select 1
            from  sysobjects
           where  id = object_id('depInfo')
            and   type = 'U')
   drop table depInfo
go

if exists (select 1
            from  sysobjects
           where  id = object_id('staInfo')
            and   type = 'U')
   drop table staInfo
go

if exists (select 1
            from  sysobjects
           where  id = object_id('userApply')
            and   type = 'U')
   drop table userApply
go

if exists (select 1
            from  sysobjects
           where  id = object_id('userInfo')
            and   type = 'U')
   drop table userInfo
go

/*==============================================================*/
/* Table: Charge                                                */
/*==============================================================*/
create table Charge (
   applyNo              int                  identity,
   require              nvarchar(30)         null,
   constraint PK_CHARGE primary key (applyNo)
)
go

/*==============================================================*/
/* Table: depInfo                                               */
/*==============================================================*/
create table depInfo (
   depId                int                  null,
   depName              nvarchar(30)         null,
   charge               nvarchar(30)         null,
   phone                nvarchar(30)         null,
   email                nvarchar(30)         null
)
go

/*==============================================================*/
/* Table: staInfo                                               */
/*==============================================================*/
create table staInfo (
   staId                int                  null,
   staName              nvarchar(30)         null,
   staPosition          nvarchar(30)         null,
   staPhone             nvarchar(30)         null,
   staSalary            money                null
)
go

/*==============================================================*/
/* Table: userApply                                             */
/*==============================================================*/
create table userApply (
   applyNo              int                  null,
   userNo               int                  null,
   meetingDate          date                 null,
   days                 int                  null,
   population           int                  null,
   address              nvarchar(30)         null,
   sign                 nvarchar(30)         null
)
go

/*==============================================================*/
/* Table: userInfo                                              */
/*==============================================================*/
create table userInfo (
   useId                int                  not null,
   useName              nvarchar(30)         null,
   account              nvarchar(30)         null,
   usePhone             nvarchar(30)         null,
   address              nvarchar(30)         null,
   constraint PK_USERINFO primary key (useId)
)
go

